package page.app.wallet;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedConditions;

import basicTool.WaitTool;
import io.appium.java_client.AppiumDriver;
import page.app.AbstractAppPage;


public class InsurancePage extends AbstractAppPage {
	@FindBy(xpath = "//UIAStaticText[@name='保险']|//android.widget.TextView[@text='保险']")
	private WebElement insuranceTitle;

	@FindBy(xpath = "//UIAStaticText[@name='立即购买']|//android.view.View[contains(@content-desc,'立即购买')]")
	private WebElement buyButton;
	
	public InsurancePage(AppiumDriver appiumDriver) {
        super(appiumDriver);
        WaitTool.waitFor(appiumDriver, ExpectedConditions.visibilityOf(insuranceTitle), DefaultWaitElementTime4Page);
        WaitTool.waitFor(appiumDriver, ExpectedConditions.visibilityOf(buyButton), DefaultWaitElementTime4Page);
    }
	
	public InsuranceBuyPage InsuranceToBuyPage () throws Exception{
		return click(buyButton,InsuranceBuyPage.class);
		
	}

}
